<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head th:replace="resource1.html">
</head>
  <body>
  <input type="hidden" id="contextPath" name="contextPath" th:value="${#request.getContextPath()}">
    <div class="x-body layui-anim">
        <form class="layui-form layui-form-pane">
        <input type="hidden" id="porType" name="porType" value="${porType}"/>
	 	<input type="hidden" id="accidentDetailsId" name="accidentDetailsId" th:value="${accidentDetailsId}"/>
	 	<input type="hidden" id="inpectionPandectId" name="inpectionPandectId" th:value="${inpectionPandectId}"/>
	 	<input type="hidden" id="unitNum" name="unitNum" value="1"/>
	 	<input type="hidden" id="operatePointId" name="operatePointId" th:value="${operatePointId}"/>
		<input type="hidden" id="operatePointName" name="operatePointName" th:value="${operatePointName}"/>
		<fieldset class="layui-elem-field layui-field-title" style="width: 98%">
		  <legend class="x-a">基本信息</legend>
		</fieldset>
           <div class="layui-form-item">
	          <table style="width: 100%;margin-left: 30px;">
		          <tr height="50px;">
			          <td>
			          	<label class="layui-form-label" style="width: 140px;">文书号：</label>
			              <div class="layui-input-inline" style="margin-top: 10px;margin-left: 10px;">
			                  <span class="x-a" th:text="${writBean.writname}+'XXXX 号'"></span>
				         	 <input type="hidden" name="writId" id="writId" value="${writBean.writid}"/>
				             <input type="hidden" name="writNumber" id="writNumber"/>
			              </div>
			          </td>
			          <td>
			          	<label class="layui-form-label" style="width: 140px;"><span class="x-red">*</span>案由：</label>
				    	<div class="layui-input-inline">
		                  <select id="causeOfActionTypeId" name="causeOfActionTypeId" onchange="dispalyCauseOfActionTypeReamrk(this.value);" lay-verify="required">
		                  		<option value="">请选择案由</option>
		                  		<option th:each="causeOfActionType : ${causeOfActionTypeList}" th:value="${causeOfActionType.causeofactiontypeid}" th:text="${causeOfActionType.causeofactiontypename}"></option>
		                  </select>
				         <span id="causeOfAction_remark_span" style="display: none"><input id="causeOfAction" name="causeOfAction" value="" style="width:250px;"class="input_execution"/></span>
		              </div>
			          </td>
		          </tr>
		          <tr height="50px;">
			          <td>
			          	<label class="layui-form-label" style="width: 140px;">
			                  <span class="x-red">*</span>案件来源：</label>
					    <div class="layui-input-inline">
			                  <select id="caseOringinTypeId" name="caseOringinTypeId" onchange="dispalyCauseOfActionTypeReamrk(this.value);" lay-verify="required">
			                  		<option value="">请选择案件来源</option>
			                  		<option th:each="caseOringinType : ${caseOringinTypeList}" th:value="${caseOringinType.caseoringintypeid}" th:text="${caseOringinType.caseoringintypename}"></option>
			                  </select>
					         	<span id="caseOringin_remark_span" style="display: none"><input id="caseOringin" name="caseOringin" value="" style="width:250px;"class="input_execution"/></span>
			              </div>
			          </td>
			          <td>
			          	<label class="layui-form-label" style="width: 140px;">
			                  <span class="x-red">*</span>处罚事项：</label>
					    <div class="layui-input-inline">
			                  <select id="punishmentItems" name="punishmentItems" lay-verify="required">
					         		<option value="">请选择</option>
					         		<option value="1">危化</option>
					         		<option value="2">职业卫生</option>
					         		<option value="3">其他</option>
					         	</select>
			              </div>
			          </td>
		          </tr>
		          <tr height="50px;">
			          <td colspan="2">
			          	<label class="layui-form-label" style="width: 140px;"><span class="x-red">*</span>案件名称：
			           </label>
			           <div class="layui-input-inline" style="width: 72%;">
			               <input type="text" id="caseName" name="caseName" required="" lay-verify="required" class="layui-input">
			           </div>
			          </td>
		          </tr>
		          <tr height="50px;">
			          <td>
			          	<label class="layui-form-label" style="width: 140px;"><span class="x-red">*</span>案件接手时间：</label>
					    <div class="layui-input-inline">
			                 <input type="text" id="contactTime" name="contactTime" required="" lay-verify="date" class="layui-input">
			             </div>
			          </td>
			          <td th:if="${underTaker!=null && underTaker!=''}">
			          	<label class="layui-form-label" style="width: 140px;">承办人：</label>
			              <div class="layui-input-inline" style="margin-top: 10px;margin-left: 10px;">
			                 <span class="x-a" th:text="${underTaker}"></span>
				         	 <input type="hidden" name="writId" id="writId" value="${writBean.writid}"/>
				             <input type="hidden" name="writNumber" id="writNumber"/>
			              </div>
			          </td>
			          <td th:unless="${underTaker!=null && underTaker!=''}">
			          	<label class="layui-form-label" style="width: 140px;"><span class="x-red">*</span>承办人：</label>
			              <div class="layui-input-inline" style="margin-top: 10px;margin-left: 10px;">
			                 <span class="x-red">*</span>承办人：<input style="width:158px;" id="undertaker_text" name="undertaker_text" value=""class="input_execution" readonly="readonly"/>
					      	    <input type="hidden" id="undertaker" name="undertaker" value=""/>
								<span id="undertakerButton">
								<input type="button" value="添加" style="width: 60px;height: 20px;font-size: 13px;line-height: 20px;border: none;background-color: #f90;color: #fff;margin-left: 10px;" onclick="myDepartmentUndertaker();"/>
								</span>
			              </div>
			          </td>
		          </tr>
		          <tr height="50px;">
			          <td colspan="2">
			          	<label class="layui-form-label" style="width: 140px;"><span class="x-red">*</span>案件基本情况：</label>
			           <div class="layui-input-inline" style="width: 72%;">
			               <textarea id="caseBrief" name="caseBrief" lay-verify="required" class="layui-textarea"></textarea>
			           </div>
			          </td>
		          </tr>
		          <tr height="50px;">
			          <td colspan="2">
			          	<label class="layui-form-label" style="width: 150px;margin-top: 10px;"><span class="x-red">*</span>承办人意见：依据</label>
			           	<div class="layui-input-inline" style="width: 71%;margin-top: 10px;">
			               <textarea id="caseBrief" name="caseBrief" th:text="${rectifyBasis}" lay-verify="required"  class="layui-textarea"></textarea>,建议立案查处；
			           </div>
			          </td>
		          </tr>
		          <tr height="50px;">
			          <td colspan="2">
			          	<label class="layui-form-label" style="width: 140px;"><span class="x-red">*</span>承办时间：</label>
			           <div class="layui-input-inline">
			               <input type="text" id="undertakeDate" name="undertakeDate" required="" lay-verify="date" class="layui-input">
			           </div>
			          </td>
		          </tr>
	          </table>
          </div>
          <fieldset class="layui-elem-field layui-field-title" style="width: 98%">
		  <legend class="x-a">当事人基本情况</legend>
		  </fieldset>
		  <table style="width: 100%;margin-left: 30px;">
		          <tr height="50px;">
			          <td colspan="2">
			          	<label class="layui-form-label" style="width: 140px;">
			                  <span class="x-red">*</span>当事人类型：</label>
					    <div class="layui-input-inline" style="width: 183px;">
			                  <select id="decisionObjectType_1" name="decisionObjectType_1" lay-filter="decisionObjectType_1" lay-verify="required">
			                  		<option value="">请选择</option>
			                  		<option value="1">单位(法人或其他组织)</option>
			                  		<option value="2">自然人</option>
			                  </select>
					         	<span id="caseOringin_remark_span" style="display: none"><input id="caseOringin" name="caseOringin" value="" style="width:250px;"class="input_execution"/></span>
			              </div>
			          </td>
		          </tr>
	          </table>
		  <div id="decisionObjectType_div_1_1">
		  <table style="width: 100%;margin-left: 30px;">
		          <tr height="50px;">
			          <td colspan="2">
			          	<label class="layui-form-label" style="width: 140px;">
			                  <span class="x-red">*</span>当事人：</label>
					    <div class="layui-input-inline" style="width: 72%;">
					    	<input id="operatePointId_1_1" name="operatePointId_1_1" value="${operatePointId}" type="hidden"/>
					    	<input type="text" id="caseName" name="caseName" required="" th:value="${operatePointName}" lay-verify="required" class="layui-input">
			            </div>
			          </td>
		          </tr>
		          <tr height="50px;">
			          <td colspan="2">
			          	<label class="layui-form-label" style="width: 140px;">当事人地址：</label>
					    <div class="layui-input-inline" style="width: 72%;">
					    	<input type="text" id="operatePointAddress_1_1" name="operatePointAddress_1_1" th:value="${registerAddress}"class="layui-input"/>
			            </div>
			          </td>
		          </tr>
		          <tr height="50px;">
			          <td>
			          	<label class="layui-form-label" style="width: 140px;">法定代表人：</label>
			              <div class="layui-input-inline">
			                  <input id="legalPerson_1_1" name="legalPerson_1_1" th:value="${legalPerson}"class="layui-input"/>
			              </div>
			          </td>
			          <td>
			          	<label class="layui-form-label" style="width: 140px;">职务：</label>
				    	<div class="layui-input-inline">
				    		<input id="duties_1_1" name="duties_1_1" th:value="${duties}" class="layui-input"/>
		                </div>
			          </td>
		          </tr>
		          <tr height="50px;">
		          	  <td>
			          	<label class="layui-form-label" style="width: 140px;"><span class="x-red">*</span>电话：</label>
				    	<div class="layui-input-inline">
				    		<input id="telephone_1_1" name="telephone_1_1" th:value="${legalPersonPhone}" lay-verify="phone" class="layui-input"/>
		                </div>
			          </td>
			          <td>
			          	<label class="layui-form-label" style="width: 140px;">邮编：</label>
			              <div class="layui-input-inline">
			                  <input id="zipCode_1_1" name="zipCode_1_1" th:value="${postCode}" class="layui-input"/>
			              </div>
			          </td>
		          </tr>
	          </table>
	          </div>
	          <div id="decisionObjectType_div_2_1" style="display: none;">
		  		<table style="width: 100%;margin-left: 30px;">
		          <tr height="50px;">
			          <td>
			          	<label class="layui-form-label" style="width: 140px;">
			                  <span class="x-red">*</span>当事人：</label>
					    <div class="layui-input-inline">
					    	<input id="operatePointName_2_1" name="operatePointName_2_1" value="" class="layui-input"/>
			            </div>
			          </td>
			          <td>
			          	<label class="layui-form-label" style="width: 140px;"> 身份证号（年龄）：</label>
					    <div class="layui-input-inline">
					    	<input id="identityCard_2_1" name="identityCard_2_1" value="" class="layui-input"/>
			            </div>
			          </td>
		          </tr>
		          <tr height="50px;">
			          <td>
			          	<label class="layui-form-label" style="width: 140px;">
			                  <span class="x-red">*</span>职务：</label>
					    <div class="layui-input-inline">
					    	<input id="duties_2_1" name="duties_2_1" value="" class="layui-input"/>
			            </div>
			          </td>
			          <td>
          				<label class="layui-form-label" style="width: 140px;">性别：</label>
					    <div class="layui-input-inline" style="width: 183px;">
					      <select id="sex_2_1" name="sex_2_1">
					      	<option value="1">男</option>
					      	<option value="2">女</option>
					      </select>
					    </div>
          			</td>
		          </tr>
		          <tr height="50px;">
			          <td colspan="2">
			          	<label class="layui-form-label" style="width: 140px;"><span class="x-red">*</span>所在单位：
			           </label>
			           <div class="layui-input-inline" style="width: 72%;">
			               <input id="operatePointId_2_1" name="operatePointId_2_1" th:value="${operatePointId}" type="hidden"/>
							<input id="company_2_1" name="company_2_1" th:value="${operatePointName}" class="layui-input"/>
			           </div>
			          </td>
		          </tr>
		          <tr height="50px;">
			          <td colspan="2">
			          	<label class="layui-form-label" style="width: 140px;"><span class="x-red">*</span>单位地址：
			           </label>
			           <div class="layui-input-inline" style="width: 72%;">
			               <input id="operatePointAddress_2_1" name="operatePointAddress_2_1" th:value="${registerAddress}" class="layui-input"/>
			           </div>
			          </td>
		          </tr>
		          <tr height="50px;">
			          <td colspan="2">
			          	<label class="layui-form-label" style="width: 140px;"><span class="x-red">*</span>家庭地址：
			           </label>
			           <div class="layui-input-inline" style="width: 72%;">
			               <input id="familyAddress_2_1" name="familyAddress_2_1" value="" class="layui-input"/>
			           </div>
			          </td>
		          </tr>
		          <tr height="50px;">
		          	  <td>
			          	<label class="layui-form-label" style="width: 140px;"><span class="x-red">*</span>电话：</label>
				    	<div class="layui-input-inline">
				    		<input id="telephone_2_1" name="telephone_2_1" value="" class="layui-input"/>
		                </div>
			          </td>
			          <td>
			          	<label class="layui-form-label" style="width: 140px;">邮编：</label>
			              <div class="layui-input-inline">
			                  <input id="zipCode_2_1" name="zipCode_2_1" value="" class="layui-input"/>
			              </div>
			          </td>
		          </tr>
	          </table>
	          </div>
	          <fieldset class="layui-elem-field layui-field-title" style="width: 98%">
			  	<legend class="x-a">其他</legend>
			  </fieldset>
			  <div class="layui-form-item">
	          <table style="width: 100%;margin-left: 30px;">
		          <tr height="50px;">
			          <td colspan="2">
			          	<label class="layui-form-label" style="width: 140px;">备注：</label>
			           <div class="layui-input-inline" style="width: 72%;">
			               <textarea id="caseBrief" name="caseBrief" class="layui-textarea"></textarea>
			           </div>
			          </td>
		          </tr>
	          </table>
          </div>
		  <button id="submitForm" style="display: none;" lay-filter="pnlPorSave" lay-submit=""></button>
      </form>
    </div>
    <script>
	    layui.use('laydate', function() {
	    	var laydate = layui.laydate;
	    	laydate.render({
	    		elem : '#contactTime'//指定元素
	    	});
	    	laydate.render({
	    		elem : '#undertakeDate'//指定元素
	    	});
	    });
    	var contextPath= getContextPath();
        layui.use(['form','layer'], function(){
            $ = layui.jquery;
          var form = layui.form
          ,layer = layui.layer;
          form.on('select(decisionObjectType_1)', function(data){
        	  if(data.value=="2"){
  				document.getElementById("decisionObjectType_div_1_1").style.display="none";
  				document.getElementById("decisionObjectType_div_2_1").style.display="";
  			}else{
  				document.getElementById("decisionObjectType_div_1_1").style.display="";
  				document.getElementById("decisionObjectType_div_2_1").style.display="none";
  			}
        	});
          //监听提交
          form.on('submit(pnlPorSave)', function(data){
            AjaxHttpRequest("/saveRole",data.field);
            return false;
          });
        });
      //动态显示案由类型备注输入框
		function dispalyCauseOfActionTypeReamrk(val){
			if(val=="99"){
				document.getElementById("causeOfAction_remark_span").style.display="";
			}else{
				document.getElementById("causeOfAction_remark_span").style.display="none";
			}
		}
		//动态显示案件来源备注输入框
		function dispalyCaseOringinTypeReamrk(val){
			if(val=="6" || val=="99"){
				document.getElementById("caseOringin_remark_span").style.display="";
			}else{
				document.getElementById("caseOringin_remark_span").style.display="none";
			}
		}
    </script>
  </body>

</html>